from django.contrib import admin

from exercise.models import QuestionGroup
from user.models import ProjUser, ProjUserGroup


# Register your models here.
class ProjUserAdmin(admin.ModelAdmin):
    list_display = ['username', 'email', ]


admin.site.register(ProjUser, ProjUserAdmin)


class QuestionGroupInline(admin.TabularInline):
    model = QuestionGroup.user_groups.through
    extra = 1
    # filter_horizontal = ('user_groups',)


class ProjUserGroupAdmin(admin.ModelAdmin):
    inlines = [QuestionGroupInline]
    filter_horizontal = ('question_groups',)
    list_display = ['creator', 'name', 'description', ]


admin.site.register(ProjUserGroup, ProjUserGroupAdmin)
